|
![](/i/fill.gif) |
These thoughts are provided merely as a point
of discussion.
Here are a few ideas about a C++ povray.
Basically, I think the biggest assets
in POV are the existing mathematics and
the scene description language. While
I feel that general compatibility with
the scene description language should
be maintained, I think the parsing
should be re-designed. Essentially,
I think that objects should know how
to parse themselves. This could be
implemented by designing a "parsable"
interface for each derived object,
and adding a new plug-in is simply a
matter of compiling in the new class.
This drags in a few more ideas, like
giving each object in the system a
name, so that when the parser encounters
the string "sphere" it knows to
construct a PovSphere object. If the
parser encounters a "FunkyNewSphere"
string, but the class is not compiled
into the binary, it can simply ignore it.
(Perhaps issuing a warning)
Would anyone like to expand the design?
Summary
-------
Base Classes:
PovObject
PovParsable
PovPrimitive
PovCamera
PovCanvas
Derived Classes:
PovSphere
PovBox
PovPlane
PovCsgUnion
PovCsgIntersection
PovCsgDifference
Detailed Information
--------------------
PovObject
Generic base class for all POV objects.
Methods:
char *getObjectName() "sphere" for example
protected constructor: setObjectName(char *)
PovParsable (is a PovObject)
Abstract interface for Input/Output
Methods:
bool supportsTextInput();
bool supportsTextOutput();
bool supportsBinaryInput();
bool supportsBinaryOutput();
constructor from istream
void writeText(ostream &os);
void writeBinary(ostream &os);
void readText(istream &is);
void readBinary(istream &is);
PovPrimitive (is a PovParsable)
Abstract interface for ray-tracable geometric object.
bool intersectRay (double &t, PovRay &ray);
int intersectsRay(vector<double> &t,PovRay &r);
PovBoundingBox boundingBox();
PovCamera (is a PovParsable)
Abstract interface for camera. All cameras
do is emit ray's.
int rays();
Ray ray(int x);
PovCanvas (is a PovParsable)
Images are formed by painting the result of
emitted camera rays onto a bitmap image.
setCamera(PovCamera &camera)
setFilename(char *filename)
render();
--
Nigel Stewart (nig### [at] eisa net au) http://www.eisa.net.au/~nigels/
Postgrad Research Student, RMIT University, Melbourne, Australia
All extremists should be taken out and shot.
Post a reply to this message
|
![](/i/fill.gif) |